{
  "swagger": "2.0",
  "info": {
    "title": "ozonmp/act_device_api/v1/act_device_api.proto",
    "version": "version not set"
  },
  "tags": [
    {
      "name": "ActNotificationApiService"
    },
    {
      "name": "ActDeviceApiService"
    }
  ],
  "consumes": [
    "application/json"
  ],
  "produces": [
    "application/json"
  ],
  "paths": {
    "/api/v1/devices": {
      "get": {
        "summary": "ListDevicesV1 - List of devices",
        "operationId": "ActDeviceApiService_ListDevicesV1",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1ListDevicesV1Response"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "type": "string",
            "format": "uint64"
          },
          {
            "name": "perPage",
            "in": "query",
            "required": false,
            "type": "string",
            "format": "uint64"
          }
        ],
        "tags": [
          "ActDeviceApiService"
        ]
      },
      "post": {
        "summary": "CreateDeviceV1 - Create a device",
        "operationId": "ActDeviceApiService_CreateDeviceV1",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1CreateDeviceV1Response"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/v1CreateDeviceV1Request"
            }
          }
        ],
        "tags": [
          "ActDeviceApiService"
        ]
      }
    },
    "/api/v1/devices/{deviceId}": {
      "get": {
        "summary": "DescribeDeviceV1 - Describe a device",
        "operationId": "ActDeviceApiService_DescribeDeviceV1",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1DescribeDeviceV1Response"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "deviceId",
            "in": "path",
            "required": true,
            "type": "string",
            "format": "uint64"
          }
        ],
        "tags": [
          "ActDeviceApiService"
        ]
      },
      "delete": {
        "summary": "RemoveDeviceV1 - Remove a device",
        "operationId": "ActDeviceApiService_RemoveDeviceV1",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1RemoveDeviceV1Response"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "deviceId",
            "in": "path",
            "required": true,
            "type": "string",
            "format": "uint64"
          }
        ],
        "tags": [
          "ActDeviceApiService"
        ]
      },
      "put": {
        "summary": "UpdateDeviceV1 - Update a device",
        "operationId": "ActDeviceApiService_UpdateDeviceV1",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1UpdateDeviceV1Response"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "deviceId",
            "in": "path",
            "required": true,
            "type": "string",
            "format": "uint64"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "type": "object",
              "properties": {
                "platform": {
                  "type": "string"
                },
                "userId": {
                  "type": "string",
                  "format": "uint64"
                }
              }
            }
          }
        ],
        "tags": [
          "ActDeviceApiService"
        ]
      }
    },
    "/api/v1/notification": {
      "get": {
        "operationId": "ActNotificationApiService_GetNotification",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1GetNotificationV1Response"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "deviceId",
            "in": "query",
            "required": false,
            "type": "string",
            "format": "uint64"
          }
        ],
        "tags": [
          "ActNotificationApiService"
        ]
      },
      "post": {
        "operationId": "ActNotificationApiService_SendNotificationV1",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1SendNotificationV1Response"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/v1SendNotificationV1Request"
            }
          }
        ],
        "tags": [
          "ActNotificationApiService"
        ]
      }
    },
    "/api/v1/notification/ack/{notificationId}": {
      "put": {
        "operationId": "ActNotificationApiService_AckNotification",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1AckNotificationV1Response"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "notificationId",
            "in": "path",
            "required": true,
            "type": "string",
            "format": "uint64"
          }
        ],
        "tags": [
          "ActNotificationApiService"
        ]
      }
    },
    "/api/v1/notification/subscribe/{deviceId}": {
      "get": {
        "operationId": "ActNotificationApiService_SubscribeNotification",
        "responses": {
          "200": {
            "description": "A successful response.(streaming responses)",
            "schema": {
              "type": "object",
              "properties": {
                "result": {
                  "$ref": "#/definitions/v1UserNotification"
                },
                "error": {
                  "$ref": "#/definitions/googlerpcStatus"
                }
              },
              "title": "Stream result of v1UserNotification"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/googlerpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "deviceId",
            "in": "path",
            "required": true,
            "type": "string",
            "format": "uint64"
          }
        ],
        "tags": [
          "ActNotificationApiService"
        ]
      }
    }
  },
  "definitions": {
    "act_device_apiv1Status": {
      "type": "string",
      "enum": [
        "STATUS_CREATED",
        "STATUS_IN_PROGRESS",
        "STATUS_DELIVERED"
      ],
      "default": "STATUS_CREATED"
    },
    "googlerpcStatus": {
      "type": "object",
      "properties": {
        "code": {
          "type": "integer",
          "format": "int32"
        },
        "message": {
          "type": "string"
        },
        "details": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/protobufAny"
          }
        }
      }
    },
    "protobufAny": {
      "type": "object",
      "properties": {
        "typeUrl": {
          "type": "string"
        },
        "value": {
          "type": "string",
          "format": "byte"
        }
      }
    },
    "v1AckNotificationV1Response": {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean"
        }
      }
    },
    "v1CreateDeviceV1Request": {
      "type": "object",
      "properties": {
        "platform": {
          "type": "string"
        },
        "userId": {
          "type": "string",
          "format": "uint64"
        }
      }
    },
    "v1CreateDeviceV1Response": {
      "type": "object",
      "properties": {
        "deviceId": {
          "type": "string",
          "format": "uint64"
        }
      }
    },
    "v1DescribeDeviceV1Response": {
      "type": "object",
      "properties": {
        "value": {
          "$ref": "#/definitions/v1Device"
        }
      }
    },
    "v1Device": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uint64"
        },
        "platform": {
          "type": "string"
        },
        "userId": {
          "type": "string",
          "format": "uint64"
        },
        "enteredAt": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "v1GetNotificationV1Response": {
      "type": "object",
      "properties": {
        "notification": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/v1UserNotification"
          }
        }
      }
    },
    "v1Language": {
      "type": "string",
      "enum": [
        "LANG_ENGLISH",
        "LANG_RUSSIAN",
        "LANG_ESPANOL",
        "LANG_ITALIAN"
      ],
      "default": "LANG_ENGLISH"
    },
    "v1ListDevicesV1Response": {
      "type": "object",
      "properties": {
        "items": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/v1Device"
          }
        }
      }
    },
    "v1Notification": {
      "type": "object",
      "properties": {
        "notificationId": {
          "type": "string",
          "format": "uint64"
        },
        "deviceId": {
          "type": "string",
          "format": "uint64"
        },
        "username": {
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "lang": {
          "$ref": "#/definitions/v1Language"
        },
        "notificationStatus": {
          "$ref": "#/definitions/act_device_apiv1Status"
        }
      }
    },
    "v1RemoveDeviceV1Response": {
      "type": "object",
      "properties": {
        "found": {
          "type": "boolean"
        }
      }
    },
    "v1SendNotificationV1Request": {
      "type": "object",
      "properties": {
        "notification": {
          "$ref": "#/definitions/v1Notification"
        }
      }
    },
    "v1SendNotificationV1Response": {
      "type": "object",
      "properties": {
        "notificationId": {
          "type": "string",
          "format": "uint64"
        }
      }
    },
    "v1UpdateDeviceV1Response": {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean"
        }
      }
    },
    "v1UserNotification": {
      "type": "object",
      "properties": {
        "notificationId": {
          "type": "string",
          "format": "uint64"
        },
        "message": {
          "type": "string"
        }
      }
    }
  }
}
